<?php
            $servername = "127.0.0.1";
            $username = "root";
            $password = "";
            $dbname = "wish";
            // 创建连接

            $conn = new mysqli($servername, $username, $password, $dbname);

            // 检测连接

            if ($conn->connect_error) {

                die("Connection failed: " . $conn->connect_error);
            } 
            $conn->query("set names 'utf8'");
?>